From b7e29a3d67e3e214ba1c958478092ee4075e8171 Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Thu, 4 Apr 2024 23:00:53 +0530
Subject: inmidst of rewriting the kdrama section. will complete it soon

---
 src/app/kdrama/[id]/page.jsx | 60 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 src/app/kdrama/[id]/page.jsx

(limited to 'src/app/kdrama/[id]/page.jsx')

diff --git a/src/app/kdrama/[id]/page.jsx b/src/app/kdrama/[id]/page.jsx
new file mode 100644
index 0000000..cd3af74
--- /dev/null
+++ b/src/app/kdrama/[id]/page.jsx
@@ -0,0 +1,60 @@
+import styles from "../styles/info.module.css";
+import Image from "next/image";
+export default async function DramaInfo({ params }) {
+	const id = decodeURIComponent(params.id);
+	const info = await getDramaInfo(id);
+
+	return (
+		<div className={styles.Main}>
+			{info && (
+				<div className={styles.DramaInfoContainer}>
+					<div className={styles.TitleContainer}>
+						<p>{info.title}</p>
+						<Image
+							src={info.image}
+							width={160}
+							height={240}
+							alt="Drama Poster"
+							priority
+						/>
+					</div>
+
+					<div className={styles.DramaDescription}>
+						<h2>Description</h2>
+						<p>{info.description}</p>
+					</div>
+
+					{/* Genres */}
+					<div className={styles.DramaGenre}>
+						<span className={styles.genreMain}>Genres: </span>
+						{info.genres &&
+							info.genres.map((item, index) => (
+								<span key={index} className={styles.genreEntry}>
+									{item}
+								</span>
+							))}
+					</div>
+
+					{/* Other names */}
+					<div className={styles.DramaGenre}>
+						<span className={styles.genreMain}>AKA: </span>
+						{info.otherNames &&
+							info.otherNames.map((item, index) => (
+								<span key={index} className={styles.genreEntry}>
+									{item}
+								</span>
+							))}
+					</div>
+				</div>
+			)}
+		</div>
+	);
+}
+
+async function getDramaInfo(id) {
+	const res = await fetch(
+		`https://consumet-api-di2e.onrender.com/movies/dramacool/info?id=${id}`
+	);
+	const data = await res.json();
+	return data;
+}
-- 
cgit v1.2.3


From 381a1cb5c14270d9bdc8cd56f17c75d79df231de Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Fri, 5 Apr 2024 09:57:47 +0530
Subject: added caching and video player

---
 src/app/kdrama/[id]/page.jsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'src/app/kdrama/[id]/page.jsx')

diff --git a/src/app/kdrama/[id]/page.jsx b/src/app/kdrama/[id]/page.jsx
index cd3af74..c891a0b 100644
--- a/src/app/kdrama/[id]/page.jsx
+++ b/src/app/kdrama/[id]/page.jsx
@@ -1,9 +1,14 @@
 import styles from "../styles/info.module.css";
 import Image from "next/image";
+import EpisodesButtons from "./buttons";
+import VideoLinkCacher from "../components/cacher";
+
 export default async function DramaInfo({ params }) {
 	const id = decodeURIComponent(params.id);
 	const info = await getDramaInfo(id);
 
+	await VideoLinkCacher(info.episodes, id);
+
 	return (
 		<div className={styles.Main}>
 			{info && (
@@ -19,6 +24,7 @@ export default async function DramaInfo({ params }) {
 						/>
 					</div>
 
+					{/* Drama description */}
 					<div className={styles.DramaDescription}>
 						<h2>Description</h2>
 						<p>{info.description}</p>
@@ -45,6 +51,9 @@ export default async function DramaInfo({ params }) {
 								</span>
 							))}
 					</div>
+
+					{/* Episodes Buttons */}
+					<EpisodesButtons data={info.episodes} id={id} />
 				</div>
 			)}
 		</div>
@@ -53,7 +62,8 @@ export default async function DramaInfo({ params }) {
 
 async function getDramaInfo(id) {
 	const res = await fetch(
-		`https://consumet-api-di2e.onrender.com/movies/dramacool/info?id=${id}`
+		`https://consumet-api-di2e.onrender.com/movies/dramacool/info?id=${id}`,
+		{ next: { revalidate: 86400 } }
 	);
 	const data = await res.json();
 	return data;
-- 
cgit v1.2.3


From 0c7581bb601b748bdb54ba9496b32a34f30c1abe Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Sat, 6 Apr 2024 15:31:11 +0530
Subject: added search functionality

---
 src/app/kdrama/[id]/page.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/app/kdrama/[id]/page.jsx')

diff --git a/src/app/kdrama/[id]/page.jsx b/src/app/kdrama/[id]/page.jsx
index c891a0b..baaf24e 100644
--- a/src/app/kdrama/[id]/page.jsx
+++ b/src/app/kdrama/[id]/page.jsx
@@ -1,13 +1,13 @@
 import styles from "../styles/info.module.css";
 import Image from "next/image";
 import EpisodesButtons from "./buttons";
-import VideoLinkCacher from "../components/cacher";
+import PreFetchVideoLinks from "../components/cacher";
 
 export default async function DramaInfo({ params }) {
 	const id = decodeURIComponent(params.id);
 	const info = await getDramaInfo(id);
 
-	await VideoLinkCacher(info.episodes, id);
+	PreFetchVideoLinks(info.episodes, id);
 
 	return (
 		<div className={styles.Main}>
-- 
cgit v1.2.3

